package com.zxx.pattern.observerPattern.observer1;

/**
 * 观察者的抽象父类
 * @author zxx on 2021/3/9
 */
public abstract class Observer {
    protected String name;
    protected Object thing;

    public void update(Object thing){
        this.thing = thing;
        System.out.println(this.name + "收到了消息：" + this.thing);
    }

    public abstract void display();

}
